<!DOCTYPE html>
<html class="no-js">

<head>
	<meta charset="utf-8">
	<title>{BEESCRM:$title}</title>
	<meta name="description" content="">
	<meta name="HandheldFriendly" content="True">
	<meta name="MobileOptimized" content="320">
	<meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui, user-scalable=no">
	<meta http-equiv="cleartype" content="on">
	<meta name="format-detection" content="telephone=no">

	<link rel="stylesheet" type="text/css" href="/assets/base/lost/css/common.css">
	<link rel="stylesheet" type="text/css" href="/assets/base/lost/css/index.css">
	<link rel="stylesheet" type="text/css" href="/assets/base/lost/css/font.css">
</head>
<body>
<div class="wraper center">
	<div class="head clearfix">
		<a href="javascript:history.go(-1);" class="iconfont icon-fanhui72 pull-left"></a>
		<span class="head-name pull-left">失物招领</span>
		<a href="/base/lost/center/lost_id/{BEESCRM:$lostId}" class="iconfont icon-gerenzhongxin pull-left text-right"></a>
	</div>
	<div class="classify clearfix">
		<a href="/base/lost/index/type_id/0/lost_id/{BEESCRM:$lostId}" <if condition="$typeid eq 0"> class="check"</if>>全部</a>
		<volist name="typelist" id="vo">
			<a href="/base/lost/index/type_id/{BEESCRM:$vo.type_id}/lost_id/{BEESCRM:$lostId}" <if condition="$vo['type_id'] eq $typeid"> class="check"</if> ><if condition="$vo['type_id'] gt 0">{BEESCRM:$vo.type_name}<else/>全部</if></a>
		</volist>
	</div>
	<div class="list-box">
		<div class="datalist">
			<volist name="data" id="vo">
				<a href="/base/lost/detail/lost_id/{BEESCRM:$lostId}/info_id/{BEESCRM:$vo.info_id}" class="lists tb-mode">
					<div class="img-box tb-cell">
						<div class="img-things"  >
							<if condition="$vo['img_url']"><img src="{BEESCRM:$vo.img_url}"/><else/><img src="/assets/base/lost/images/tolerant.jpg"/></if>
						</div>
					</div>
					<div class="tb-cell"><p class="title">{BEESCRM:$vo.info_name}</p><p class="time">发布时间：{BEESCRM:$vo.create_time|date="Y-m-d",###}</p></div>
					<if condition="$vo['status'] eq 1"><p class="tb-cell yirenling"><img src="/assets/base/lost/images/yrling.png"/></p></if>
					<if condition="$vo['status'] eq 3"><p class="tb-cell yirenling line"><img src="/assets/base/lost/images/line.png"/></p></if>
					<p class="tb-cell you text-right"><span class="iconfont icon-you"></span></p>
					<if condition="$vo['status'] eq 1"><span class="cover"></span></if>
					<if condition="$vo['status'] eq 3"><span class="cover"></span></if>
				</a>
			</volist>
		</div>
		<input type="hidden" id="count" value="{BEESCRM:$pageCount}">
		<div class="bottom-box">
			<p class="copyright">杭州青橄榄网络技术有限公司 技术支持</p>
		</div>
	</div>
<a href="{BEESCRM::U('/base/lost/honor',array('lost_id'=>$lostId))}" class="bang"><img src="/assets/base/found/images/record.png"/></a>
</div>
<div class="scrm-loadding">
	<svg width="95" height="20" id="gb-loading">
		<rect width="20" height="20" x="0" y="0" rx="3" ry="3">
			<animate attributeName="width" values="0;20;20;20;0" dur="1000ms" repeatCount="indefinite"/>
			<animate attributeName="height" values="0;20;20;20;0" dur="1000ms" repeatCount="indefinite"/>
			<animate attributeName="x" values="10;0;0;0;10" dur="1000ms" repeatCount="indefinite"/>
			<animate attributeName="y" values="10;0;0;0;10" dur="1000ms" repeatCount="indefinite"/>
		</rect>
		<rect width="20" height="20" x="25" y="0" rx="3" ry="3">
			<animate attributeName="width" values="0;20;20;20;0" begin="200ms" dur="1000ms" repeatCount="indefinite"/>
			<animate attributeName="height" values="0;20;20;20;0" begin="200ms" dur="1000ms" repeatCount="indefinite"/>
			<animate attributeName="x" values="35;25;25;25;35" begin="200ms" dur="1000ms" repeatCount="indefinite"/>
			<animate attributeName="y" values="10;0;0;0;10" begin="200ms" dur="1000ms" repeatCount="indefinite"/>
		</rect>
		<rect width="20" height="20" x="50" y="0" rx="3" ry="3">
			<animate attributeName="width" values="0;20;20;20;0" begin="400ms" dur="1000ms" repeatCount="indefinite"/>
			<animate attributeName="height" values="0;20;20;20;0" begin="400ms" dur="1000ms" repeatCount="indefinite"/>
			<animate attributeName="x" values="60;50;50;50;60" begin="400ms" dur="1000ms" repeatCount="indefinite"/>
			<animate attributeName="y" values="10;0;0;0;10" begin="400ms" dur="1000ms" repeatCount="indefinite"/>
		</rect>
		<rect width="20" height="20" x="75" y="0" rx="3" ry="3">
			<animate attributeName="width" values="0;20;20;20;0" begin="800ms" dur="1000ms" repeatCount="indefinite"/>
			<animate attributeName="height" values="0;20;20;20;0" begin="800ms" dur="1000ms" repeatCount="indefinite"/>
			<animate attributeName="x" values="85;75;75;75;85" begin="800ms" dur="1000ms" repeatCount="indefinite"/>
			<animate attributeName="y" values="10;0;0;0;10" begin="800ms" dur="1000ms" repeatCount="indefinite"/>
		</rect>
	</svg>
</div>
<script src="/assets/base/lost/js/jquery-2.1.0.min.js"></script>
<script>
	var height = $(window).height();
	var height_c = $('.classify').outerHeight();
	var height_h = $('.head').outerHeight();
	$('.list-box').css({'paddingTop':height_c+height_h,'minHeight':height,'overflow':'auto'});
	$('.classify').css('top',height_h);
	$('.head').css({'position':'fixed' , 'left': 0 , 'top': 0 ,'zIndex' : 1000,'width': '100%'});

	var bottombox_height = $('.bottom-box').outerHeight();
	$('.lost-box').css("paddingBottom",bottombox_height);

	$('.scrm-loadding').hide();
	/* $(document).ready(function () {
		$(document).on('click','.tb-mode',function(){
			var id = $(this).data('info_id');
			window.location.href = "/base/lost/detail/lostId/{BEESCRM:$lostId}/info_id/"+id;
		});
	}); */

	$('.scrm-loadding').hide();

	$(function(){
		$('.classify-box').on('click','.classify-list',function(){
			$(this).addClass('check').siblings().removeClass('check');
		});

		var page = 1;
		var pageCount = $("#count").val();
		$(window).scroll(function() {
			//当内容滚动到底部时加载新的内容
			if ($(window).scrollTop() + $(window).height() + 20 > $(document).height()) {
				//当前要加载的页码
				page++;
				if(page <= pageCount){
					LoadPage(page);
				}
			}
		});

		function LoadPage(page) {
			var lostId={BEESCRM:$lostId};
			
			$.ajax({
				'url': "/base/lost/doAjaxPage?type_id={BEESCRM:$typeid}&lost_id={BEESCRM:$lostId}",
				'data': {p: page},
				'dataType': 'html',
				'type': 'GET',
//				'async': false,
				beforeSend: function(){
					$('.scrm-loadding').show();
				},
				success: function (data) {
//					if (data.status == 'S') {
//						var info = data.data;
//						var string = '';
//						$(info).each(function (idx) {
//							var val = info[idx];
//							var img_url = '';
//							var info_id = val.info_id;
//							if(val.img_url){
//								img_url = val.img_url;
//							}else{
//								img_url = '/assets/base/lost/images/tolerant.jpg';
//							}
//
//							var yrl = '';
//							var cov = '';
//							if(val.status == 1){
//								yrl = '<p class="tb-cell yirenling"><img src="/assets/base/lost/images/yrling.png"/></p>';
//								cov = '<span class="cover"></span>';
//							}
//							if(val.status == 3){
//								yrl = '<p class="tb-cell yirenling line"><img src="/assets/base/lost/images/line.png"/></p>';
//								cov = '<span class="cover"></span>';
//							}else{
//								yrl = '';
//								cov = '';
//							}
//							string = string+'<a class="lists tb-mode" href="/base/lost/detail/lost_id/'+lostId+'/info_id/'+info_id+'">'
//							+'<div class="img-box tb-cell">'
//							+'<div class="img-things" data-info_id="'+info_id+'">'
//							+'<img src="'+img_url+'"/>'
//							+'</div>'
//							+'</div>'
//							+'<div class="tb-cell"><p class="title">'+val.info_name+'</p><p class="time">发布时间：'+val.create_time+'</p></div>'
//							+yrl
//							+'<p class="tb-cell you text-right"><span class="iconfont icon-you"></span></p>'
//							+cov
//							+'</a>';
//						});
						$('.datalist').append(data);
						$('.scrm-loadding').hide();
						$('.datalist').append(string);
					}
//				}
			});
		}
	})
</script>
</body>
</html>
